<div class="well">
  <h5>组织机构管理</h5>
  <hr>

  <form name="createForm" class="form-horizontal" role="form"
        ng-init="send('user.index', {});"
        ng-submit="create_command();">

    <div class="form-group">
      <label class="col-sm-2 control-label required">单位名称</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" ng-model="organ_new.name" required ng-disabled="command == 'edit'">
      </div>
    </div>


    <div class="form-group">
      <label class="col-sm-2 control-label required">单位成员名单</label>
      <div class="col-lg-10">
        <div ng-switch on="selected_member_index.length">
          <span class="text-warning" ng-switch-when="0">暂无，请至少选择一名成员！</span>
          <ul ng-switch-default><li ng-repeat="t in selected_member_index">
              <span>{{t.name}} 【{{t.login}}】</span>
              <span>
                <a href ng-click="organ_new.assign = remove_member(organ_new.assign, t);">
                  <i class="fa fa-remove fa-1x text-warning"></i>
                </a>
              </span>
          </li></ul>
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-lg-offset-2 col-lg-2">
        <p class="form-control-static">增加人员:</p>
      </div>
      <div class="col-lg-6">
        <select class="form-control" ng-model="member_new" ng-options="m.dn as (m.name + '【' + m.login + '】') for m in avail_member_index">
          <option value="">-- 请选择 --</option>
        </select>
      </div>
      <div class="col-lg-2">
        <p class="form-control-static" ng-show="member_new.length > 0">
          <a href ng-click="organ_new.assign = add_member(organ_new.assign, member_new); member_new = '';">
            <i class="fa fa-check fa-1x"></i>
          </a>
        </p>
      </div>
    </div>
    <hr>

    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <input class="btn btn-primary" type="submit" ng-disabled="createForm.$invalid || (selected_member_index.length == 0)"/>
        或者
        <a ui-sref="setting.organ.organ">取消</a>
      </div>
    </div>
  </form>
</div>

<hr>
